﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DataChangeTools.Utils.Constants
{
    public static class CommonConstants
    {

        public static string GetAppName()
        {
            var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
            if (attributes.Length > 0)
            {
                var titleAttribute = (AssemblyTitleAttribute)attributes[0];
                if (!string.IsNullOrEmpty(titleAttribute.Title))
                {
                    return titleAttribute.Title;
                }
            }
            return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
        }

        public static string GetAppVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
        public static string GetAppName2 = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();

    }
}
